﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DMEditor
{
    public partial class frmSettings : Form
    {
        public frmSettings()
        {
            InitializeComponent();
        }

        private void btnAccept_Click(object sender, EventArgs e)
        {
            Program.module.currentPort = listMIDIPorts.SelectedIndex;
            Program.module.Open(listMIDIPorts.SelectedIndex);

            Close();

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void frmSettings_Load(object sender, EventArgs e)
        {
            ddlModuleType.SelectedIndex = 0;
            ddlSoundset.SelectedIndex = 0;

            for (int i = 0; i < Program.module.ports.Count; ++i)
            {
                listMIDIPorts.Items.Add(Program.module.ports[i]);
            }

            listMIDIPorts.SelectedIndex = Program.module.currentPort;
        }

    }
}
